package com.zcg.blogger.model;

import java.io.Serializable;
import java.util.Date;

import org.hibernate.validator.constraints.NotEmpty;

/**
 * 文章评论
 * @author 张晨刚
 *
 */
public class Comment implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int id;
	

	/**
	 * 评论内容
	 */
	private String content;
	
	/**
	 * 评论时间
	 */
	private Date time;
	
	/**
	 * 点赞数
	 */
	private int praise;
	
	/**
	 * 所评论的文章
	 */
	private Article article;
	
	/**
	 * 评论者
	 */
	private User user;
	
	private User commentUser;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@NotEmpty(message="评论不能为空")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Article getArticle() {
		return article;
	}

	public void setArticle(Article article) {
		this.article = article;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public int getPraise() {
		return praise;
	}

	public void setPraise(int praise) {
		this.praise = praise;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public User getCommentUser() {
		return commentUser;
	}

	public void setCommentUser(User commentUser) {
		this.commentUser = commentUser;
	}

	@Override
	public String toString() {
		return "Comment [id=" + id + ", Content=" + content + ", Time=" + time
				+ ", article=" + article + ", user=" + user + ", commentUser="
				+ commentUser + "]";
	}

}
